<?php 
class IndexController extends Controller{
	public function __construct(){
		parent::__construct();
		if(!isset($_SESSION['admin'])){
			$this->gourl(__APP__ . "?c=login");
		}
	}
	public function index(){
		$this->display();
	}
	public function welcome(){
		$this->display();
	}
	public function add_admin(){
		$this->display();
	}
	public function add_cate(){
		$this->display();
	}
	public function add_top_cate(){
		$this->display();
	}
	public function admin(){
		$this->display();
	}
	public function answer(){
		$answer = $_GET['answer'];
		switch($answer){
			case 1:
				$sql = "SELECT * FROM hd_answer";
				break;
				
			case 2:
				$sql = "SELECT * FROM hd_answer WHERE accept=0";
				break;
				
			case 3:
				$sql = "SELECT * FROM hd_answer WHERE accept=1";
				break;
		}
		$arr = M('hd_answer')->query($sql);
		$this->assign('arr', $arr);
		$num = count($arr);
		$this->assign('num', $num);
		$this->display();
	}
	public function ask(){
		$ask = $_GET['ask'];
		switch($ask){
			case 1:
				$sql = "SELECT * FROM hd_ask";
				break;
				
			case 2:
				$sql = "SELECT * FROM hd_ask WHERE solve=0";
				break;
				
			case 3:
				$sql = "SELECT * FROM hd_ask WHERE solve=1";
				break;
				
			case 4:
				$sql = "SELECT * FROM hd_ask WHERE answer=0";
				break;
		}
		$arr = M('hd_ask')->query($sql);
		$this->assign('arr', $arr);
		$num = count($arr);
		$this->assign('num', $num);
		$this->display();
	}
	public function category(){
		
		$this->display();
	}
	public function edit_cate(){
		$this->display();
	}
	public function login(){
		$this->display();
	}
	public function passwd(){
		$this->display();
	}
	public function rule_level(){
		$this->display();
	}
	public function rule_point(){
		$this->display();
	}
	public function user_list(){
		$arr = M('hd_user')->all();
		$this->assign('arr', $arr);
		$this->display();
	}
	public function web_set(){
		$this->display();
	}
}
?>